package com.admin.service.impl;

import com.admin.entity.CopyRight;
import com.admin.mapper.CopyRightMapper;
import com.admin.service.ICopyRightService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@SuppressWarnings("ALL")
@Service
public class CopyRightServiceImpl extends ServiceImpl<CopyRightMapper, CopyRight> implements ICopyRightService {

    @Autowired
    private CopyRightMapper copyRightMapper;

    /**
     * 查所有版权
     *
     * @param page
     * @param limit
     * @return
     */
    @Override
    public IPage selCopyRight(int page, int limit, String leibie) {
        Page p = new Page(page, limit);
        QueryWrapper s = new QueryWrapper();
        if (leibie != null && leibie != "") {
            s.like("copyrighttype", leibie);
        }
        IPage q = copyRightMapper.selectPage(p, s);
        return q;
    }

}
